const express = require("express");
const router = require("./routers/index.js");
const staticRouter = require("./routers/staticfile.js");
const paramsRouter = require("./routers/params.js");
const dbRouter = require("./routers/database.js");
const bodyParse = require("body-parser");


const app = express();

app.use(express.static('assets'));

app.use(bodyParse.urlencoded({
  extended: true,
}))


// 配置服务器访问的地址（路由）
app.use("/api", router)
app.use("/static", staticRouter)
app.use("/api/params", paramsRouter)
app.use("/db", dbRouter)




app.listen(3227, () => {
  console.log("服务器运行在3227上");
})